package com.shop.loan.controller;

import com.shop.loan.model.Question;
import com.shop.loan.model.common.Constant;
import com.shop.loan.model.common.ResResult;
import com.shop.loan.model.vo.QuestionVo;
import com.shop.loan.service.QuestionService;
import io.swagger.annotations.*;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(value = "常见问题", tags = "常见问题")
@RestController
@RequestMapping(Constant.appPrefex + "/question")
public class QuestionController {

    @Resource
    QuestionService questionService;

    @ApiOperation("问题列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "类型", dataType = "string"),
            @ApiImplicitParam(name = "pageSize", value = "页面条数", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageNum", value = "第几页  从1开始", dataType = "int", required = true),
    })
    @ApiResponses({
            @ApiResponse(code = 1, message = "成功", response = Question.class)
    })
    @PostMapping("/list")
    public ResResult list(@Ignore QuestionVo question) {
        return questionService.list();
    }

}
